package com.zj.z11select.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zj.z11select.entity.IndexImg;
import com.zj.z11select.exception.CustomException;
import com.zj.z11select.mapper.IndexImgMapper;
import com.zj.z11select.service.IndexImgService;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 轮播图  服务实现类
 * </p>
 *
 * @author ZHOUJIE
 * @since 2021-08-09
 */
@Service
public class IndexImgServiceImpl extends ServiceImpl<IndexImgMapper, IndexImg> implements IndexImgService {

    @Resource
    private IndexImgMapper indexImgMapper;

    @Override
    public List<IndexImg> selectIndexImgList() {
        List<IndexImg> indexImgList = this.indexImgMapper.selectIndexImgList();
        if (!CollectionUtils.isEmpty(indexImgList)){
            return indexImgList;
        }
        throw new CustomException("查询失败");
    }
}
